﻿using System.Collections.Generic;

namespace BasicAdoNet
{
    public class Region
    {
        private readonly ITerritoriesRepository _territoriesRepository;

        public Region(ITerritoriesRepository territoriesRepository)
        {
            _territoriesRepository = territoriesRepository;
        }

        public int Id { get; set; }
        public string Description { get; set; }

        public IEnumerable<Territory> GetTerritories()
        {
            return _territoriesRepository.GetTerritoriesByRegionId(Id);
        }
    }
}